package com.ctshk.sapp.payment.controller;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.enums.OrderSource;
import com.ctshk.common.model.AppReq;
import com.ctshk.common.utils.RequestUtil;
import com.ctshk.rpc.payment.dto.PayDetailsDTO;
import com.ctshk.rpc.payment.dto.RefundDetailsDTO;
import com.ctshk.rpc.payment.enums.PaymentMethod;
import com.ctshk.rpc.payment.req.CallPayReq;
import com.ctshk.rpc.payment.req.RefundReq;
import com.ctshk.rpc.payment.service.IPayRecordService;
import com.ctshk.rpc.payment.service.IPayService;
import com.ctshk.rpc.payment.service.IRefundRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/**
 * @BelongsProject: ctshk-cloud
 * @BelongsPackage: com.ctshk.sapp.payment.controller
 * @Author: hef
 * @CreateTime: 2021-04-20 18:12
 * @Description: 描述
 */
@Slf4j
@Controller
@RequestMapping("/pay/temp")
@Api(value = "支付服务", tags = "支付服务")
public class PayTempController {

    @ApiOperation(value = "支付服务-唤起支付(Visa/Master)", notes = "机场快线-唤起支付(Visa/Master)")
    @GetMapping("/callPay")
    public ModelAndView callPayCard(@Param("sessionId") String sessionId, @Param("merchantId") String merchantId, @Param("merchantName") String merchantName
            , @Param("orderId") String orderId, @Param("orderDescription") String orderDescription) {
        ModelAndView modelAndView = new ModelAndView("visa");
        modelAndView.addObject("sessionId", sessionId);
        modelAndView.addObject("merchantId", merchantId);
        modelAndView.addObject("merchantName", merchantName);
        modelAndView.addObject("orderId", orderId);
        modelAndView.addObject("orderDescription", orderDescription);
        return modelAndView;
    }
}
